package com.example.util;

public class ReflectionUtil {

    /**
     * 获取调用方法的名称
     * @return
     */
    public static String getCallMethod(){
        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
        String method = stack[3].getMethodName();
        return method;
    }

    public static String getNakCallMethod(){
        StackTraceElement stack[] = Thread.currentThread().getStackTrace();
        String[] className = stack[3].getClassName().split("\\.");
        String fullName = className[className.length-1]+"."+stack[3].getMethodName();
        return fullName;
    }
}
